package com.example.demo.thread;


import java.util.ArrayList;
import java.util.concurrent.*;

/**
 * @author chenchao
 * @desc
 * @date 2022/2/17 11:55
 */
public class Block   {

    public static void main(String[] args) {
       new  LinkedBlockingQueue();
       new ArrayBlockingQueue(5);
       new ConcurrentLinkedQueue(new ArrayList());
       new SynchronousQueue();
       new ThreadFactory(){

           @Override
           public Thread newThread(Runnable r) {
               Thread thread =new Thread(r,"6666");
               thread.setDaemon(true);
               return thread;
           }
       };
        System.out.println( Runtime.getRuntime().availableProcessors());
        new BB().thread.start();
    }
}
    class  BB   implements  Runnable{

         Thread thread=new Thread(this);
        public void run() {
            System.out.println("TT");
        }
    }
